package com.chat.websocket.entity.enums;

/**
 * SunJingxuan
 * 2022 \ 08 \ 01
 */

public enum GlobalConstants {

	// 全局
	ERROR(-1, "服务器摸鱼去了,先给您做条红烧鱼吧"),
	SUCCESS(200, "成功"),

	// 用户
	USER_LOGIN_ERR(15000, "登陆异常"),
	USER_NOT_EXIST(15001, "未找到此用户"),
	USER_PASSWORD_ERR(15002, "密码错误"),
	USER_GET_VERIFY_CODE(15003, "获取验证码异常"),
	USER_VERIFY_CODE_WRONG(15004, "验证码错误"),
	USER_VERIFY_CODE_ERR(15005, "验证码校验异常"),

	//redis
	REDIS_CONNECTION_ERR(25000, "redis连接异常"),
	REDIS_SET_ERR(25001, "redis存储出错"),
	REDIS_SET_TIME_OUT_ERR(25002, "redis设置超时时间异常"),
	REDIS_GET_TIME_OUT_ERR(25003, "redis获取超时时间异常"),
	REDIS_GET_VALUE_ERR(25004, "redis获取值异常"),
	REDIS_DEL_VALUE_ERR(25005, "redis删除值异常"),
	REDIS_EXISTS_ERR(25006, "redis查询值是否存在异常"),
	REDIS_UPDATE_VALUE_ERR(25007, "redis更新值异常"),

	// ip地址
	IP_ADDRESS_GET_ERR(35000, "ip地址获取异常"),
	MAC_ADDRESS_GET_ERR(35001, "MAC地址获取异常"),

	// websocket
	WEB_SOCKET_ERR(45000, "通讯异常"),

	// 发消息
	SEND_MESSAGE_ERR(55000, "发送失败"),

	// minio
	MINIO_ERR(65000, "文件存储服务异常"),
	MINIO_BUCKET_NAME_IS_NULL_ERR(65001, "桶名不能为空"),
	MINIO_BUCKET_EXISTS_ERR(65002, "已存在的桶，不能创建相同名称的桶"),
	MINIO_BUCKET_NOT_EXISTS_ERR(65003, "不存在的桶，桶名："),
	MINIO_DELETE_FILE_ERR(65004, "删除文件失败"),
	MINIO_UP_FILE_IS_NULL_ERR(65005, "文件为空"),
	MINIO_FILE_NAME_IS_NULL_ERR(65006, "文件名为空"),
	MINIO_FILE_NOT_EXISTS_ERR(65007, "文件不存在");

	private final Integer code;
	private final String message;

	GlobalConstants(Integer code, String message) {
		this.code = code;
		this.message = message;
	}

	public Integer getCode() {
		return code;
	}

	public String getMessage() {
		return message;
	}
}
